<template>
    <div class="min-h-screen bg-gray-100">
        <!-- 导航栏 -->
        <nav class="bg-white shadow-lg">
            <div class="max-w-7xl mx-auto px-4">
                <div class="flex justify-between h-16">
                    <div class="flex">
                        <div class="flex-shrink-0 flex items-center">
                            <h1 class="text-xl font-bold text-gray-800">CSA Anti-Poison</h1>
                        </div>
                        <div class="hidden sm:ml-6 sm:flex sm:space-x-8">
                            <router-link
                                v-for="item in navItems"
                                :key="item.path"
                                :to="item.path"
                                class="inline-flex items-center px-1 pt-1 border-b-2"
                                :class="[
                                    $route.path === item.path
                                        ? 'border-blue-500 text-gray-900'
                                        : 'border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700'
                                ]"
                            >
                                {{ item.name }}
                            </router-link>
                        </div>
                    </div>
                </div>
            </div>
        </nav>

        <!-- 主要内容 -->
        <main class="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8">
            <router-view></router-view>
        </main>
    </div>
</template>

<script setup>
import { API_BASE_URL } from './config'

const navItems = [
    { name: '首页', path: '/' },
    { name: '搜索', path: '/search' },
    { name: '漏洞列表', path: '/vulnerabilities' },
    { name: '样本列表', path: '/samples' },
    { name: '关于', path: '/about' }
]

// 全局配置 API 基础 URL
window.API_BASE_URL = API_BASE_URL
</script> 